#include <repository/employee/payroll_record_repository.h>

using namespace model;

// CRUD Operations
insert_ret_type
PayrollRecordRepository::create(const PayrollRecordDTO& payroll_record_dto)
{
  return _insert(payroll_record_dto);
};


update_ret_type PayrollRecordRepository::updateById(const in_id_type id,
                                                    const PayrollRecordDTO& dto)
{
  return _update(dto, db::payroll_record{}.id == id);
};

delete_ret_type PayrollRecordRepository::removeById(const in_id_type id)
{
  return _remove(db::payroll_record{}.id == id);
}

// Custom Queries
select_ret_type<PayrollRecordDTO> PayrollRecordRepository::getAll()
{
  return _select(db::payroll_record{}.id >= 0);
}

select_ret_type<PayrollRecordDTO>
PayrollRecordRepository::getByPage(int page_size, int offset)
{
  return _select_from(db::payroll_record{}.id >= 0, page_size, offset);
}

count_type PayrollRecordRepository::count()
{
  return _countById();
}

// 其他方法实现...
